package com.bolt.support.query.nativequery;


import com.bolt.support.sqlconfig.base.SqlStatement;
import com.bolt.support.sqlconfig.builder.SqlTemplateFactory;

import javax.persistence.EntityManager;

public abstract class AbstractQuery implements IQuery {

    protected final EntityManager entityManager;

    protected final SqlTemplateFactory sqlTemplateFactory;

    public AbstractQuery(EntityManager entityManager, SqlTemplateFactory sqlTemplateFactory) {
        this.entityManager = entityManager;
        this.sqlTemplateFactory = sqlTemplateFactory;
    }

    public SqlStatement getSqlStatement(String sqlId) {
        SqlStatement sqlStatement = sqlTemplateFactory.find(sqlId);
        return sqlStatement;
    }


}

 